import React, {Component} from "react";
import {UserItem} from "../UserItem";
import PropTypes from "prop-types";
import './index.css'

export class UserList extends Component {
    static propTypes = {
        todos:PropTypes.array.isRequired,
        deleteTodo:PropTypes.func.isRequired,
        checkDone:PropTypes.func.isRequired
        
    }
    render() {
        const {todos,deleteTodo,checkDone} = this.props
        return (
            <ul className="todo-main">
                {
                    todos.map((item)=>{
                        return <UserItem key={item.id} item={item} deleteTodo={deleteTodo} checkDone={checkDone}/>
                    })
                }
            </ul>
        )
    }
}